// Name：P2_7.c
// Purpose：给定整数的最小组成
// Author：wjy
// From：《C语言程序设计：现代方法》（第二版）第二章第7题
// Date：2021.12.29

#include <stdlib.h>
#include <stdio.h>

int main(void)
{
    int amount;
    int doller_20;
    int doller_10;
    int doller_5;
    int doller_1;
    printf ("Enter a doller amount:");
    scanf ("%d", &amount);
    doller_20 = amount / 20;
    amount = amount - doller_20 * 20;
    doller_10 = amount / 10;
    amount = amount - doller_10 * 10;
    doller_5 = amount / 5;
    amount = amount - doller_5 * 5;
    doller_1 = amount / 1;
    printf ("$20 bills:%d\n", doller_20);
    printf ("$10 bills:%d\n", doller_10);
    printf ("$5 bills:%d\n", doller_5);
    printf ("$1 bills:%d\n", doller_1);
    system("pause");
    return 0;
}